package redisTool

import (
	"CommonsProject/conf"
	"fmt"
	"github.com/go-redis/redis/v8"
)

var ClientRedis *redis.Client

const (
	CAPTCHA_VERIFY          = "systemRouter:captcha"
	LOGIN_USER_REDIS_PREFIX = "systemRouter:loginUser"
	SYSTEM_AUTHORITY        = "systemRouter:authorityMAP"
)

// 初始化Redis
func init() {
	redisConfig := conf.GlobalConfig.Redis
	ClientRedis = redis.NewClient(&redis.Options{
		Addr:     fmt.Sprintf("%s:%d", redisConfig.Host, redisConfig.Port),
		Password: redisConfig.Password,
		DB:       redisConfig.Db,
	})
}
